package com.jcsz.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jcsz.common.to.mq.SeckillOrderTo;
import com.jcsz.common.utils.PageUtils;
import com.jcsz.gulimall.order.entity.OrderEntity;
import com.jcsz.gulimall.order.entity.OrderReturnReasonEntity;
import com.jcsz.gulimall.order.vo.*;
import com.rabbitmq.client.Channel;
import org.springframework.boot.autoconfigure.amqp.RabbitProperties;
import org.springframework.amqp.core.Message;

import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author 一把Po吉他
 * @email volibear@gulimall.com
 * @date 2022-10-16 09:23:25
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void testRabbitMQSend();

    void testRabbitMQReceive(Message message, OrderReturnReasonEntity reasonEntity, Channel channel) throws IOException;
    void testRabbitMQReceive(Message message, OrderEntity orderEntity, Channel channel);


    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    SubmitOrderResponseVo  submitOrder(OrderSubmitVo orderSubmitVo);

    OrderEntity getInfoByOrderSn(String orderSn);

    void orderClose(OrderEntity orderEntity);

    PayVo getPayVoByOrderSn(String orderSn);

    PageUtils listWithItem(Map<String, Object> params);

    String handlePayResult(PayAsyncVo asyncVo);

    void createSeckillOrder(SeckillOrderTo seckillOrderTo);
}

